﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;

namespace ZoambieGaem {
    class Player {
        
        //Konstruktööri
        public Player(Texture2D texture, Master m) {
            this._health = 100;
            this._picturesLeft = 0;
            this._texture = texture;
            this._routeUpdate = 200;
            this._angle = MathHelper.ToRadians(90);
            this._worldPosition = new Vector2(200, 200);
            this._width = (int)(this.texture.Width * m.drawScale);
            this._height = (int)(this.texture.Height * m.drawScale);
            this._centerX = this.texture.Width / 2;
            this._centerY = this.texture.Height / 2;
            this._gettingDamage = false;
        }









        static readonly object healthLocker = new object();
        private int _health;
        public int health {
            get {
                lock (healthLocker) {
                    return _health;
                }
            }
            set {
                lock (healthLocker) {
                    _health = value;
                }
            }
        }

        static readonly object picturesLeftLocker = new object();
        private int _picturesLeft;
        public int picturesLeft {
            get {
                lock (picturesLeftLocker) {
                    return _picturesLeft;
                }
            }
            set {
                lock (picturesLeftLocker) {
                    _picturesLeft = value;
                }
            }
        }

        static readonly object textureLocker = new object();
        private Texture2D _texture;
        public Texture2D texture {
            get {
                lock (textureLocker) {
                    return _texture;
                }
            }
            set {
                lock (textureLocker) {
                    _texture = value;
                }
            }
        }

        static readonly object worldPositionLocker = new object();
        private Vector2 _worldPosition;
        public Vector2 worldPosition {
            get {
                lock (worldPositionLocker) {
                    return _worldPosition;
                }
            }
            set {
                lock (worldPositionLocker) {
                    _worldPosition = value;
                }
            }
        }

        static readonly object angleLocker = new object();
        private float _angle;
        public float angle {
            get {
                lock (angleLocker) {
                    return _angle;
                }
            }
            set {
                lock (angleLocker) {
                    _angle = value;
                }
            }
        }

        static readonly object screenPositionLocker = new object();
        private Vector2 _screenPosition;
        public Vector2 screenPosition {
            get {
                lock (screenPositionLocker) {
                    return _screenPosition;
                }
            }
            set {
                lock (screenPositionLocker) {
                    _screenPosition = value;
                }
            }
        }

        static readonly object widthLocker = new object();
        private int _width;
        public int width {
            get {
                lock (widthLocker) {
                    return _width;
                }
            }
            set {
                lock (widthLocker) {
                    _width = value;
                }
            }
        }

        static readonly object heightLocker = new object();
        private int _height;
        public int height {
            get {
                lock (heightLocker) {
                    return _height;
                }
            }
            set {
                lock (heightLocker) {
                    _height = value;
                }
            }
        }

        static readonly object centerXLocker = new object();
        private int _centerX;
        public int centerX {
            get {
                lock (centerXLocker) {
                    return _centerX;
                }
            }
            set {
                lock (centerXLocker) {
                    _centerX = value;
                }
            }
        }

        static readonly object centerYLocker = new object();
        private int _centerY;
        public int centerY {
            get {
                lock (centerYLocker) {
                    return _centerY;
                }
            }
            set {
                lock (centerYLocker) {
                    _centerY = value;
                }
            }
        }

        static readonly object routeUpdateLocker = new object();
        private int _routeUpdate;
        public int routeUpdate {
            get {
                lock (routeUpdateLocker) {
                    return _routeUpdate;
                }
            }
            set {
                lock (routeUpdateLocker) {
                    _routeUpdate = value;
                }
            }
        }

        static readonly object gettingDamageLocker = new object();
        private Boolean _gettingDamage;
        public Boolean gettingDamage {
            get {
                lock (gettingDamageLocker) {
                    return _gettingDamage;
                }
            }
            set {
                lock (gettingDamageLocker) {
                    _gettingDamage = value;
                }
            }
        }

        static readonly object damageAngleLocker = new object();
        private float _damageAngle;
        public float damageAngle {
            get {
                lock (damageAngleLocker) {
                    return _damageAngle;
                }
            }
            set {
                lock (damageAngleLocker) {
                    _damageAngle = value;
                }
            }
        }

        static readonly object damageSpeedLocker = new object();
        private float _damageSpeed;
        public float damageSpeed {
            get {
                lock (damageSpeedLocker) {
                    return _damageSpeed;
                }
            }
            set {
                lock (damageSpeedLocker) {
                    _damageSpeed = value;
                }
            }
        }


    }
}
